package com.cskaoyan.controller;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.po.MarketBrand;
import com.cskaoyan.service.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wei
 * @since 2022/09/08 21:53
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {
    @Autowired
    WxBrandService brandService;
//    Request URL: http://182.92.235.201:8083/wx/brand/list?
//    page=1&limit=10
//Request Method: GET
//Status Code: 200
    @GetMapping("list")
    public BaseRespVo brandList(int page,int limit){
        CommonData commonData = brandService.queryBrandList(page, limit);
        return BaseRespVo.ok(commonData);
    }
//    Request URL: http://182.92.235.201:8083/wx/brand/detail?id=1001000
//Request Method: GET
//Status Code: 200
    @GetMapping("detail")
    public  BaseRespVo brandDetail(Integer id){
        MarketBrand marketBrand=brandService.queryBrandDetail(id);
            return BaseRespVo.ok(marketBrand);
    }

}

